let formatDate = function (num) {
    // num = parseInt(num);
    let dd = new Date();
    dd.setDate(dd.getDate()+num)
    var m = dd.getMonth()+1
    m = m<0?'0' + m : m
    var d = dd.getDate()
    d = d<10 ? '0'+d:d
    var w = dd.getDay()
    let xq;
    if (num==0){
        xq='今天'
    }else if(num==1){
        xq='明天'
    }else if(num==2){
        xq='后天'
    }else if(num>2){
        switch (w){
            case 0:
                xq='周日'
                break;
            case 1:
                xq='周一'
                break;
            case 2:
                xq='周二'
                break;
            case 3:
                xq='周三'
                break;
            case 4:
                xq='周四'
                break;
            case 5:
                xq='周五'
                break;
            case 6:
                xq='周六'
                break;
            default:break
        }
    }
    
    return {m,d,w,xq}
}
export default formatDate
  